class Dog{
    name:String;
    age:number;
    //constructor在创建对象时调用
    constructor(name:String,age:number){
        //this表示当前对象
        this.name = name ;
        this.age = age;
    }
    brak(){
        alert('汪汪汪');
    }
}
const dog=new Dog('小白',1);
console.log(dog);